<template>
  <div class="components-container">
   <SingleImage></SingleImage>
    
  </div>
</template>

<script>


export default {
  name: 'AvatarUploadDemo',
  components: { SingleImage },
  data() {
    return {
      baseUrl:process.env.VUE_APP_BASE_API + 'files/uploadPic',
      imagecropperShow: false,
      imagecropperKey: 0,
      image: 'https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'
    }
  },
  created(){
    console.log(this.baseUrl)
  },
  methods: {
    cropSuccess(resData) {
      this.imagecropperShow = false
      this.imagecropperKey = this.imagecropperKey + 1
      this.image = resData.files.avatar
    },
    upload(data,fileName){
      console.log(data)
      console.log(fileName)
      
      uploadPic(data).then(res=>{
        
      })
    },
    close() {
      this.imagecropperShow = false
    }
  }
}
</script>

<style scoped>
  .avatar{
    width: 200px;
    height: 200px;
    border-radius: 50%;
  }
</style>

